Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Implement token wrapper library and complete token tester #7

Merged
merged 2 commits into from
Nov 9, 2020
Merged

feat: Implement token wrapper library and complete token tester #7

merged 2 commits into from
Nov 9, 2020

Conversation

shiki-tak
Copy link
Contributor

@shiki-tak shiki-tak commented Nov 5, 2020

Closes: #3

Description

This PR should be merged after #6 has been merged.
After PR#6 is merged, I'll combine the commits into one, so files such as the circleci config will be stripped out of the changed files.

Motivation and context

How has this been tested?

Checklist:

  • I followed the contributing guidelines.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

Copy link
Contributor

@loloicci loloicci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How is it tested or how do you plan to test it?

docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="devcontract_token_tester",target=/code/contracts/staking/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.9.0 ./contracts/token-tester
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not 0.9.1?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The other contract of v0.10.0 uses 0.9.0, so it is combined.

@shiki-tak
Copy link
Contributor Author

How is it tested or how do you plan to test it?

I'm going to add a test using linkwasmd/cli which is included in link-modules.

@loloicci loloicci self-requested a review November 6, 2020 06:53
) -> StdResult<Binary> {
let res = LinkTokenQuerier::new(&deps.querier)
.query_balance(contract_id, address)
.unwrap();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure, so I'm asking a question. If the query result is not Ok, how does the flow after unwrap?

Copy link
Contributor Author

@shiki-tak shiki-tak Nov 6, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the current cosmwasm, the out of gas message should be returned.
Since this is a sample contract, I don't care about it, but I should split the process as follows, depending on whether the result is Ok or not.

https://github.com/line/cosmwasm/pull/7/files/96cc89a09f447d4ea38e75eccabcb2d72e771807#diff-44426a838e3c8f2756e4887005d64ccc271fe53b8b466f732fe9fba1bf82c007R325

},
QueryTotalParam {
contract_id: String,
target: String,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making this as an enum?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I changed as an enum.

@shiki-tak shiki-tak merged commit 26ee37e into Finschia:develop Nov 9, 2020
loloicci pushed a commit that referenced this pull request Jan 26, 2021
* feat: Implement token wrapper library and complete token tester

* fix: used enum for target param
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants